/**
 * FileName: MemberIntefaceImpl
 * Author:   杨兴
 * Date:     2019/8/14 10:20
 * Description: 会员服务实现
 */
package com.xiongmao.gongyu.service;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MemberIntefaceImpl implements MemberInteface{



    @HystrixCommand(fallbackMethod = "fallBackMember")
    @RequestMapping(value = "/getMemberData",method = RequestMethod.GET)
    public String getMemberData(@RequestParam("name")String name){

        System.out.println("getMemberData");
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("helloworld");
        return "hello world"+name;
    }

    public String fallBackMember(String name){
        System.out.println("member服务降级");
        return "member服务降级";
    }
}
